<%--
  Created by IntelliJ IDEA.
  User: lsj
  Date: 2025/10/31
  Time: 02:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="UTF-8" %>
<html>
<head>
  <title>员工管理系统 - 登录</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: #f5f5f5;
    }
    .login-container {
      width: 300px;
      padding: 30px;
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    .form-group { margin-bottom: 20px; }
    label { display: block; margin-bottom: 5px; font-weight: bold; }
    input[type="text"], input[type="password"] {
      width: 100%;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 4px;
      box-sizing: border-box;
    }
    button {
      width: 100%;
      padding: 12px;
      background: #007bff;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 16px;
    }
    button:hover {
      background: #0056b3;
    }
    .error {
      color: red;
      margin-bottom: 15px;
      padding: 10px;
      background: #ffe6e6;
      border: 1px solid #ffcccc;
      border-radius: 4px;
    }
    h2 {
      text-align: center;
      margin-bottom: 30px;
      color: #333;
    }
  </style>
</head>
<body>
<div class="login-container">
  <h2>员工管理系统</h2>
  <c:if test="${not empty error}">
    <div class="error">${error}</div>
  </c:if>
  <form action="${pageContext.request.contextPath}/login" method="post">
    <div class="form-group">
      <label>用户名:</label>
      <input type="text" name="username" required value="${param.username}">
    </div>
    <div class="form-group">
      <label>密码:</label>
      <input type="password" name="password" required>
    </div>
    <button type="submit">登录</button>
  </form>
</div>
</body>
</html>
